feat(web): expose read-only terminal session history - #397
Conversation
tt-a1i
left a comment
There was a problem hiding this comment.
The read-only terminal-history bridge is valuable, but its current discovery path introduces a P2 history-size-dependent workload on every page and preview. The inline finding was reproduced with real default Pi Session files; focused adapter/host tests pass42/42. Please correct the source-read boundary before merge. No author code was modified, and no installed/deployed performance measurement is claimed.
|
Source-read follow-up (2026-09-09). This PR is still the leftover file-history slice, not live attach. Status. OPEN, What this PR actually does. What it is not. Opening that JSONL later is history. It does not attach the Web Host to the TUI process that still has the file open. Background Terminal / Subagent / Workflow managers are process-local objects keyed by the live Relation to Please keep the P2 source-read fix on this PR (discover the selected workspace first; bound and cancel transcript work; prove unrelated workspace files are not parsed). Rebase onto current main after that. Do not expand the PR into live attach, and do not treat a future merge as “Web can see my running TUI |
|
Replacement-test follow-up (2026-09-09). Head still Must hold
Missing vs current 42/42 (single-fixture) tests — fail closed
Keep existing label / empty- |
|
Fixed and pushed as
|
Problem
Related to #347. The Web workbench has no way to discover compatible terminal/default Pi Sessions without copying them into Web storage or switching the active Web controller. This makes existing history invisible and risks conflating observer access with control.
Value
Provides a bounded, explicit read-only bridge to Pi's default Session source so users and future UI work can inspect terminal history while preserving Pi files and controller ownership as the authority.
Approach
GET /api/terminal-sessionslisting with bounded query, cursor, and limit validation.SessionManager.listAll()(Pi's default Session source).pathinspection returning a bounded preview from the existingloadSessionPreviewDataloader, including omission/byte evidence.source: "pi-default",origin: "terminal", andreadOnly: true.Validation
biome format/biome lint --error-on-warnings: passed.tsc --noEmit: passed.SESSION_NOT_FOUNDreceipt to a generic 500; the boundary was restored.bunis not installed in this environment, so equivalent repository scripts were run with the bundled Node 24 executable and local Biome/Vitest binaries.Impact